import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css'
import { createRouter, createWebHistory } from 'vue-router'
import createRouteGuard from "@/router/guard";
import { RootRoute } from "./constants";

NProgress.configure({ showSpinner: false }) // NProgress Configuration

const router = createRouter({
  history: createWebHistory(),
  routes: [RootRoute],
  // 是否应该禁止尾部斜杠。默认为假
  strict: true,
  scrollBehavior() {
    return { top: 0 }
  }
})

createRouteGuard(router)

export default router
